/*
 * This file is part of yapk (yet another (auto) process killer) driver.
 *
 * Copyright (C) 2011 by Mateusz Wojcik <mewojcik@gmail.com>
 *
 * This is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; either version 2.1 of
 * the License, or (at your option) any later version.
 *
 * This software is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this software; if not, write to the Free
 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
 */
#ifndef __UTILS_H__
#define __UTILS_H__

/**
 * \brief Returns process name from PEPROCESS structure.
 * 
 * This is simplest solution to take process name that is
 * working also with pre-Vista windows versions.
 */
extern char* PsGetProcessImageFileName(PEPROCESS p);

/**
 * \brief This function is responsible for retrieving 
 *        process name from process id handle.
 *
 * @param ProcessId process identifier.
 * @param [out] ProcessNameBuff ptr to buffer that will hold process name.
 * @param MaxLength maximum leght of string to be copied.
 * @return TRUE if everything is ok, FALSE otherwise.
 */
BOOLEAN RetrieveProcessNameByID(HANDLE ProcessId, CHAR* ProcessNameBuffer, int MaxLength);

#endif /*__UTILS_H__*/
